ostree.git
12 years agoAdd an OstreeSysrootUpgrader API
Colin Walters [Sun, 23 Mar 2014 12:54:28 +0000 (08:54 -0400)]
Add an OstreeSysrootUpgrader API

This moves some utility code from the ostree tool into the shared
library, which will make it easier to consume by external tools.

12 years agoMove basic commit API into ostree_sysroot_simple_write_deployment()
Colin Walters [Sun, 23 Mar 2014 15:36:09 +0000 (11:36 -0400)]
Move basic commit API into ostree_sysroot_simple_write_deployment()

The admin commands had this shared in tool common, but we want to
encourage external programs to do this as well.

12 years agoAdd missing admin commands in the man pages
Michael Scherer [Sat, 22 Mar 2014 10:45:45 +0000 (11:45 +0100)]
Add missing admin commands in the man pages

12 years agoimprove consistency with others admin commands
Michael Scherer [Sat, 22 Mar 2014 10:14:24 +0000 (11:14 +0100)]
improve consistency with others admin commands

12 years agoFix typo in man page ( envrionment => environment )
Michael Scherer [Sat, 22 Mar 2014 10:13:44 +0000 (11:13 +0100)]
Fix typo in man page ( envrionment => environment )

12 years agoRelease 2014.3
Colin Walters [Fri, 21 Mar 2014 18:54:03 +0000 (14:54 -0400)]
Release 2014.3

12 years agopull: Don't print, just use progress callback
Colin Walters [Fri, 21 Mar 2014 18:52:56 +0000 (14:52 -0400)]
pull: Don't print, just use progress callback

More work on removing g_print() from the library.

12 years agopull: End status line on error as well
Colin Walters [Mon, 17 Mar 2014 23:39:59 +0000 (19:39 -0400)]
pull: End status line on error as well

This way we don't append the error to the current line.

12 years agocore: Add "admin instutil set-kargs"
Colin Walters [Mon, 17 Mar 2014 23:24:56 +0000 (19:24 -0400)]
core: Add "admin instutil set-kargs"

This will be used by Anaconda as a convenience command to set the
bootloader arguments.

12 years agolibostree: Add ostree_sysroot_deployment_set_kargs()
Colin Walters [Mon, 17 Mar 2014 23:24:10 +0000 (19:24 -0400)]
libostree: Add ostree_sysroot_deployment_set_kargs()

It turns out people sometimes want to be able to change the kernel
arguments.  Add a convenient API to do so for the current deployment.

This will be used by Anaconda.

12 years agolibostree: Fix ostree_deployment_clone() to also clone bootconfig
Colin Walters [Mon, 17 Mar 2014 23:21:39 +0000 (19:21 -0400)]
libostree: Fix ostree_deployment_clone() to also clone bootconfig

This way one can easily mutate it for a new deployment list.

12 years agolibostree: Add ostree_bootconfig_parser_clone()
Colin Walters [Mon, 17 Mar 2014 23:21:05 +0000 (19:21 -0400)]
libostree: Add ostree_bootconfig_parser_clone()

This will be necessary to fix ostree_deployment_clone(), but is
potentially useful on its own for other consumers.

12 years agoAdd "ostree admin instutil", move selinux-ensure-labeled there
Colin Walters [Mon, 17 Mar 2014 16:28:36 +0000 (12:28 -0400)]
Add "ostree admin instutil", move selinux-ensure-labeled there

There are going to be a few utilities that are only useful for
installers and disk image creation tools.  Let's not expose them all
at the toplevel; instead, hide them under "instutil".

12 years agotest-sysroot: Use GSystem to spawn subprocess
Colin Walters [Wed, 19 Mar 2014 13:13:28 +0000 (09:13 -0400)]
test-sysroot: Use GSystem to spawn subprocess

I was getting a weird hang in the installed tests with the shell as a
zombie process, not reaped by the parent, which was just stuck in
select() on the output pipes.  The thing is we don't actually want to
capture stdout/stderr, we just want to inherit.

GSystem.Subprocess makes that possible, so let's just use it now that
it's a proper installed library.

12 years agoRevert "Disable test-sysroot.test"
Colin Walters [Wed, 19 Mar 2014 13:15:29 +0000 (09:15 -0400)]
Revert "Disable test-sysroot.test"

This reverts commit 73868a96d14fa13e69d9df778d2363b89f41fef5.

12 years agoDisable test-sysroot.test
Vadim Rutkovsky [Wed, 19 Mar 2014 12:08:37 +0000 (13:08 +0100)]
Disable test-sysroot.test

It hangs on test-sysroot.js:40 during GLib.spawn_command_line_sync - it seems it can't
handle sh -c and the inner process becomes a zombie

12 years agoTODO: update
Colin Walters [Sat, 15 Mar 2014 23:05:52 +0000 (19:05 -0400)]
TODO: update

12 years agoRemove custom SELinux policy
Colin Walters [Sat, 15 Mar 2014 17:15:58 +0000 (13:15 -0400)]
Remove custom SELinux policy

This was a temporary hack until the requisite bits landed upstream in
the Fedora SELinux policy.

12 years agolibostree: Fix crash if output is not a tty
Colin Walters [Sat, 15 Mar 2014 01:59:35 +0000 (21:59 -0400)]
libostree: Fix crash if output is not a tty

This was a recent regression.

12 years agolibostree: Add API to append a GPG signature
Colin Walters [Sat, 15 Mar 2014 01:57:47 +0000 (21:57 -0400)]
libostree: Add API to append a GPG signature

This will be used by rpm-ostree which needs to use an external program
to sign commits.

12 years agolibostree: Add a better error if we fail to read keyring directory
Colin Walters [Fri, 14 Mar 2014 18:42:45 +0000 (14:42 -0400)]
libostree: Add a better error if we fail to read keyring directory

I had accidentally put it in the -devel package and not noticed.

12 years agoadmin: selinux-ensure-labeled: new builtin
Colin Walters [Thu, 13 Mar 2014 12:14:26 +0000 (08:14 -0400)]
admin: selinux-ensure-labeled: new builtin

Code like rpm-ostree generates disk images directly.  In order to
ensure SELinux labeling is correct, it currently has a helper program
that runs over the deployment root, then over the whole disk and to
only set a label if none exist.

In order to make it easier to write installers such as Anaconda
without having them depend on rpm-ostree (or whatever other
build-server side program), pull in the helper code here.

12 years agodeploy: Less usage of g_print
Colin Walters [Tue, 11 Mar 2014 17:16:37 +0000 (13:16 -0400)]
deploy: Less usage of g_print

No need to spam the console here.

12 years agolibostree: Remove g_print() from bootloader code
Colin Walters [Tue, 11 Mar 2014 17:15:57 +0000 (13:15 -0400)]
libostree: Remove g_print() from bootloader code

No need to be so chatty.

12 years agopull: Drop some g_print(), replace others with async progress
Colin Walters [Tue, 11 Mar 2014 13:36:54 +0000 (09:36 -0400)]
pull: Drop some g_print(), replace others with async progress

We shouldn't g_print() from a library, particularly when the
expectation is that the client has an async progress set up.

This should fix the pull output extending the status line.

12 years agopull: Ensure temporary data that appears corrupted is deleted
Colin Walters [Sat, 8 Mar 2014 00:30:01 +0000 (19:30 -0500)]
pull: Ensure temporary data that appears corrupted is deleted

If a MITM attacker (or just network corruption) causes a temporary
downloaded object in tmp/ to be corrupted, we'll end up
continually trying to commit it, and fail.

Fix this unlinking the temp file immediately after opening it.  This
will ensure that if we exit due to an error (or crash), the kernel
will clean up the space for us.

https://bugzilla.gnome.org/show_bug.cgi?id=725924

12 years agopackaging: Update internal spec file
Colin Walters [Sat, 1 Mar 2014 20:46:03 +0000 (15:46 -0500)]
packaging: Update internal spec file

12 years agobuild: Add --enable-selinux-custom-policy
Colin Walters [Sat, 1 Mar 2014 20:10:39 +0000 (15:10 -0500)]
build: Add --enable-selinux-custom-policy

Don't use this.

It's just for me, and only temporarily until this stuff all lands in
the Fedora (and ideally upstream) selinux-policy.

12 years agoRelease 2014.2
Colin Walters [Sat, 1 Mar 2014 18:55:55 +0000 (13:55 -0500)]
Release 2014.2

12 years agoAdd /run/ostree-booted
Colin Walters [Fri, 28 Feb 2014 08:48:23 +0000 (03:48 -0500)]
Add /run/ostree-booted

The idea with this is that things like yum should be able to look for
it and determine whether or not they should assume that they can
change things on the system.

https://bugzilla.gnome.org/show_bug.cgi?id=725380

12 years agoupgrade/switch: Fix status line being overwritten with pull progress
Colin Walters [Thu, 27 Feb 2014 21:25:33 +0000 (16:25 -0500)]
upgrade/switch: Fix status line being overwritten with pull progress

12 years agocheckout: Use fd-relative open of newly created directory
Colin Walters [Thu, 27 Feb 2014 16:49:49 +0000 (11:49 -0500)]
checkout: Use fd-relative open of newly created directory

We were walking the full path again on our directories, no need to do
that.

12 years agocheckout: Only fchown/fchmod directories after we're done populating them
Colin Walters [Thu, 27 Feb 2014 16:19:33 +0000 (11:19 -0500)]
checkout: Only fchown/fchmod directories after we're done populating them

See https://mail.gnome.org/archives/ostree-list/2014-February/msg00020.html

12 years agoUpdate libgsystem, use it to set dirfd-relative xattrs on symlinks
Colin Walters [Wed, 26 Feb 2014 21:34:37 +0000 (16:34 -0500)]
Update libgsystem, use it to set dirfd-relative xattrs on symlinks

This is a bit more efficient in that we're not walking full paths, and
it helps avoid security/reliability issues if an attacker (or just a
misbehaving process) has the ability to mutate paths in the middle.

12 years agoupgrade: Properly set origin_refspec variable for resolve/printing
Colin Walters [Wed, 26 Feb 2014 20:12:46 +0000 (15:12 -0500)]
upgrade: Properly set origin_refspec variable for resolve/printing

1) We were ignoring the remote, which is broken
2) We were printing NULL later on

12 years agoswitch: Don't check whether revision matches
Colin Walters [Wed, 26 Feb 2014 20:12:08 +0000 (15:12 -0500)]
switch: Don't check whether revision matches

It's quite possible that say "buildmaster" and "smoketested" are the
same revision - but we should allow switching between them.

12 years agopull: Remove explicit threading
Colin Walters [Fri, 21 Feb 2014 17:56:41 +0000 (12:56 -0500)]
pull: Remove explicit threading

Mixing async and threads has proved to be too much for my little mind.
It has race conditions that I've tried repeatedly to fix, but failed.

The threading here was scanning metadata objects - and there are
two parts to that:

1) Physically loading them from disk
2) Parsing them

Now #1 has been partially addressed by avoiding a storm of lstat() if
we're starting from a known working state.  If pull gets interrupted,
then we do need to rescan all objects.  Also, we can address this with
local metadata packfiles.

The other potentially slow bit is that we recurse across the metadata,
blocking the main thread.  We could ameliorate that in the future by
scheduling metadata parsing as idle "chunks".

Anyways, let's move the needle back to reliability, and readd speed
more carefully.

https://bugzilla.gnome.org/show_bug.cgi?id=706456

12 years agoupgrade: Refuse chronologically older commits unless --allow-downgrade
Colin Walters [Thu, 20 Feb 2014 23:25:56 +0000 (18:25 -0500)]
upgrade: Refuse chronologically older commits unless --allow-downgrade

We don't want to allow MITM attackers to intercept upgrade requests
and provide clients with older OS versions vulnerable to security
flaws.

Only "ostree admin upgrade" gets this behavior for now - whether we
want to do it for "ostree admin switch" is another question.

12 years agorepo: Fix crash without SELinux policy enabled during commit
Colin Walters [Thu, 20 Feb 2014 19:19:49 +0000 (14:19 -0500)]
repo: Fix crash without SELinux policy enabled during commit

12 years agobuild: Fix build without SELinux
Colin Walters [Thu, 20 Feb 2014 15:12:53 +0000 (10:12 -0500)]
build: Fix build without SELinux

12 years agolibostree: Split off SELinux OstreeSePolicy class
Colin Walters [Wed, 19 Feb 2014 13:40:29 +0000 (08:40 -0500)]
libostree: Split off SELinux OstreeSePolicy class

It's better if this is independent from the OstreeSysroot; for
example, a policy is active in a given deployment root at once, not
for a sysroot globally.

We can also collect SELinux-related API in one place.

Unfortunately at the moment there can be only one instance of this
class per process.

12 years agoAdd internal SELinux policy overrides
Colin Walters [Wed, 19 Feb 2014 13:37:54 +0000 (08:37 -0500)]
Add internal SELinux policy overrides

In the future, this will likely include an ostree_t domain.  For now,
this is just a few additional allow rules.

12 years agomanual-tests: New directory with custom test scripts
Colin Walters [Fri, 14 Feb 2014 23:16:10 +0000 (18:16 -0500)]
manual-tests: New directory with custom test scripts

This is just a demo script.

12 years agofetcher: set timeouts on HTTP connections
Daniel Drake [Thu, 13 Feb 2014 16:57:10 +0000 (10:57 -0600)]
fetcher: set timeouts on HTTP connections

We're seeing some hangs while ostree is fetching updates.
I imagine the fact that SoupSessionAsync has no timeout by default
could be the cause of this.

Set timeout values to 60 seconds, which is the default for the new
SoupSession API which we may switch to later.

https://bugzilla.gnome.org/show_bug.cgi?id=724310

12 years agobuild: make "sudo make install" over existing install work
Colin Walters [Thu, 13 Feb 2014 15:57:05 +0000 (10:57 -0500)]
build: make "sudo make install" over existing install work

12 years agoos-init: also create a symlink for /var/lock
Cosimo Cecchi [Wed, 12 Feb 2014 01:15:19 +0000 (17:15 -0800)]
os-init: also create a symlink for /var/lock

After creating one for /var/run. This is needed at least on Debian
systems.

12 years agodeploy: Remove now-unimplemented --no-bootloader argument
Colin Walters [Wed, 12 Feb 2014 21:47:39 +0000 (16:47 -0500)]
deploy: Remove now-unimplemented --no-bootloader argument

12 years agoboot/ostree-remount.service: run before tmpfiles.d
Daniel Drake [Tue, 11 Feb 2014 22:13:34 +0000 (16:13 -0600)]
boot/ostree-remount.service: run before tmpfiles.d

tmpfiles.d configurations generally require write access to some places
that are read-only until ostree-remount runs.

Make sure ostree-remount has run first.

Thanks to Cosimo Cecchi for finding and diagnosing this problem.

https://bugzilla.gnome.org/show_bug.cgi?id=724183

12 years agorepo: Split generic GPG commit verification out into helper
Colin Walters [Mon, 10 Feb 2014 13:50:59 +0000 (08:50 -0500)]
repo: Split generic GPG commit verification out into helper

This will be used for a future commit which GPG verifies static
deltas.

12 years agodeltas: Add a timestamp to delta metadata
Colin Walters [Mon, 10 Feb 2014 13:29:00 +0000 (08:29 -0500)]
deltas: Add a timestamp to delta metadata

12 years agopull: Remove a duplicate hash table
Colin Walters [Sun, 9 Feb 2014 21:02:14 +0000 (16:02 -0500)]
pull: Remove a duplicate hash table

Not sure why we had two...perhaps the code originally had them
separate.

12 years agotests: Fix up GPG tests for more strict EL7 GPG
Colin Walters [Mon, 10 Feb 2014 14:38:07 +0000 (09:38 -0500)]
tests: Fix up GPG tests for more strict EL7 GPG

These GPG tests were failing for me on EL7 - it appears to be because
we had only one directory for both private and public keys, and we
were giving that to ostree for verification, which passed them onto
gpgv.

In EL7 beta at least, gpgv now barfs if it finds a private key where
it is just expecting to find public keys.

Fix this by splitting out the public trusted directory from the
private key directory.  Except now for signing, we still need the
public key there, so symlink it.  Whee!

12 years agorepo: Don't set GPG engine executable path
Colin Walters [Mon, 10 Feb 2014 14:10:13 +0000 (09:10 -0500)]
repo: Don't set GPG engine executable path

The instructions one finds on the internets are apparently wrong, we
really need to keep the default here, since gpgme uses it to actually
find the helper binary it runs.

This fixes the GPG tests for me on EL7 at least.

12 years agoDrop refs/summary
Colin Walters [Sun, 9 Feb 2014 19:01:27 +0000 (14:01 -0500)]
Drop refs/summary

I'm not aware of anyone using this, and it's not efficient to write a
whole file every time a ref changes, plus it's not atomic.

12 years agosysroot: Add a log with MESSAGE_ID when deployment is complete
Colin Walters [Sun, 9 Feb 2014 18:17:24 +0000 (13:17 -0500)]
sysroot: Add a log with MESSAGE_ID when deployment is complete

12 years agopull: Don't crash if the URL is not found
Colin Walters [Thu, 6 Feb 2014 08:46:14 +0000 (03:46 -0500)]
pull: Don't crash if the URL is not found

12 years agoInitial basic static delta code drop
Colin Walters [Thu, 15 Aug 2013 13:17:37 +0000 (09:17 -0400)]
Initial basic static delta code drop

This has a very basic level of functionality (deltas can be generated,
and applied offline).  There is only some stubbed out pull code to
fetch them via HTTP.

But, better to commit this now and improve it from a known starting
point, rather than have it languish in a branch.

12 years agocore: Import bup's "rollsum" code, add a test case
Colin Walters [Thu, 15 Aug 2013 13:14:26 +0000 (09:14 -0400)]
core: Import bup's "rollsum" code, add a test case

For static deltas, one strategy that will be employed is to split each
object into chunks, and only include changed chunks in the deltas.

12 years agobuild: Drop SELinux required version a bit earlier
Colin Walters [Sun, 2 Feb 2014 16:53:22 +0000 (11:53 -0500)]
build: Drop SELinux required version a bit earlier

Apparently EPEL7 only has 2.1.13, but we should be fine with that.

12 years agobuild: Fix --without-selinux case
Colin Walters [Sun, 2 Feb 2014 16:49:43 +0000 (11:49 -0500)]
build: Fix --without-selinux case

12 years agoSELinux: Ensure we label /var, and fix /etc merge wrt xattrs
Colin Walters [Sun, 2 Feb 2014 16:32:52 +0000 (11:32 -0500)]
SELinux: Ensure we label /var, and fix /etc merge wrt xattrs

First, /var needs to be labeled at least once.  We should probably
rearrange things so that /var is only created (and labeled) on the
first deployment, but this patch adds a /var/.ostree-selabeled file
instead.

Second, when doing the /etc merge, we compare the xattrs of the old
/usr/etc versus the current /etc.  The problem with that is that the
policy has different labels for /usr/etc on disk than the real /etc.

The correct fix for this is a bit invasive - we have to take the
physical content of the old /usr/etc, but compare the labels as if
they were really in /etc.

Instead for now, just ignore changes to xattrs.  If the file
content/mode changes, then we take the new file (including any changed
xattrs).

Bottom line: just doing chcon -t blah_t /etc/foo.conf may be lost on
upgrade (for now).

12 years agolibostree: Also use xattr callback for directories
Colin Walters [Sat, 1 Feb 2014 16:30:10 +0000 (11:30 -0500)]
libostree: Also use xattr callback for directories

They need labels too, obviously.

12 years agoAdd --disable-fsync option to pull-local, and API to repo
Colin Walters [Sat, 1 Feb 2014 03:18:13 +0000 (22:18 -0500)]
Add --disable-fsync option to pull-local, and API to repo

This will be used by guestmount - it's WAY faster.  We only take disks
as a unit, so it's safe.  If the process fails halfway through, we
just start over from scratch the next time anyways.

12 years agoAdd SELinux support
Colin Walters [Wed, 29 Jan 2014 14:22:16 +0000 (09:22 -0500)]
Add SELinux support

The trees as shipped come with /usr/etc, which should just be labeled
as usr_t.  When we do a deployment, we need to relabel the copies of
the files we're making in /etc.

SELinux support is compile and runtime optional.

12 years agorepo: Add API to provide xattrs
Colin Walters [Wed, 29 Jan 2014 13:03:45 +0000 (08:03 -0500)]
repo: Add API to provide xattrs

This will be used by rpm-ostree to provide SELinux security contexts,
without requiring us to actually label the disk.

12 years agobuild: Look for /usr/bin/gpgv2 vs /usr/bin/gpgv
Colin Walters [Fri, 31 Jan 2014 00:32:59 +0000 (19:32 -0500)]
build: Look for /usr/bin/gpgv2 vs /usr/bin/gpgv

For some reason, RHEL has gpgv, but Fedora doesn't.  We need to detect
which to use, since presumably Debian only has gpgv.

12 years agorepo: Improve GPG error messages
Colin Walters [Thu, 30 Jan 2014 22:17:36 +0000 (17:17 -0500)]
repo: Improve GPG error messages

The signing test is failing here on EL7 beta for me - it seems like
gnupg isn't honoring the homedir.

12 years agolibostree: Actually trusted.gpg.d/*.gpg for GPG verification
Colin Walters [Thu, 30 Jan 2014 20:40:46 +0000 (15:40 -0500)]
libostree: Actually trusted.gpg.d/*.gpg for GPG verification

The intent of this code I'm fairly certain was to use *.gpg from the
trusted.gpg.d, directory.  But right now, we're only using
"pubring.gpg" from that directory, which is odd.

Let's fix this to use all keys ending in .gpg, which will also
include pubring.gpg.

12 years agobuild: Install README-gpg in /usr/share/ostree/trusted.gpg.d
Colin Walters [Thu, 30 Jan 2014 20:27:10 +0000 (15:27 -0500)]
build: Install README-gpg in /usr/share/ostree/trusted.gpg.d

Since this is what the current code actually reads.

12 years agoostree-prepare-root.service: Also order before plymouth-switch-root.service
Colin Walters [Mon, 27 Jan 2014 18:57:18 +0000 (13:57 -0500)]
ostree-prepare-root.service: Also order before plymouth-switch-root.service

In the OSTree model, /sysroot gets set up twice.  We need to ensure
that the /sysroot plymouth sees is only after OSTree has set it up.

12 years agoboot/ostree-remount.service: Run before plymouth-read-write.service
Colin Walters [Mon, 27 Jan 2014 16:57:35 +0000 (11:57 -0500)]
boot/ostree-remount.service: Run before plymouth-read-write.service

The plymouth service needs a writable /var, so ensure that we run
before it does.

12 years agodoc: Update manpage a bit
Colin Walters [Mon, 27 Jan 2014 14:10:42 +0000 (09:10 -0500)]
doc: Update manpage a bit

I know, I know, it's about time...

12 years agoRelease 2014.1
Colin Walters [Fri, 24 Jan 2014 04:26:43 +0000 (04:26 +0000)]
Release 2014.1

12 years agopull: Be less chatty with G_MESSAGES_DEBUG=all
Colin Walters [Wed, 22 Jan 2014 15:02:01 +0000 (15:02 +0000)]
pull: Be less chatty with G_MESSAGES_DEBUG=all

Only note state *transitions*, don't spam on simple checks.

12 years agoTODO: Update
Colin Walters [Wed, 22 Jan 2014 11:11:50 +0000 (11:11 +0000)]
TODO: Update

12 years agotests: Only install test-corruption if gjs is found
Colin Walters [Tue, 21 Jan 2014 19:53:06 +0000 (19:53 +0000)]
tests: Only install test-corruption if gjs is found

It now uses a gjs-based helper.

12 years agopull: Add remotename:ref syntax
Colin Walters [Tue, 21 Jan 2014 08:57:34 +0000 (08:57 +0000)]
pull: Add remotename:ref syntax

This is really the common case.

12 years agoREADME: Just link to wiki, move most of it to README-historical.md
Colin Walters [Mon, 20 Jan 2014 23:00:09 +0000 (18:00 -0500)]
README: Just link to wiki, move most of it to README-historical.md

12 years agorepo: Document ostree_repo_sign_commit(), and add introspection data
Colin Walters [Mon, 20 Jan 2014 17:13:37 +0000 (12:13 -0500)]
repo: Document ostree_repo_sign_commit(), and add introspection data

The important bit for introspection is (allow-none) on the homedir.

12 years agopull: Close another race
Colin Walters [Mon, 20 Jan 2014 11:17:45 +0000 (06:17 -0500)]
pull: Close another race

Only send _IDLE messages if and only if we state transition the main
thread (from idle -> !idle or !idle -> idle).  This ensures that we
don't send IDLE, then get it back, and process that when we're !idle.

12 years agopull: Hopefully squash race where we would exit early
Colin Walters [Sun, 19 Jan 2014 23:12:44 +0000 (18:12 -0500)]
pull: Hopefully squash race where we would exit early

This is a redesign (again) of the pull code.  It is simpler and
survives 20 minutes of testing in a loop, whereas the old code would
only go from 30 seconds to 2 minutes.

The problem with the old code was that there was a race where we might
determine idle state even when there are content requests in flight
between the metadata thread and the main one.

This code majorly reworks things - there's now only one IDLE message,
sent in a circle from the main thread, through the metadata scanner,
and back to the main one.

Crucially it's only sent when the *main* thread is idle.  Previously
we were looking at whether the metadata scanner is idle, but that
doesn't make a lot of sense.  First let's make sure the main thread is
idle, then verify that the metadata one is.

This closes the loop because we'll have ensured we get any pending
requests.

https://bugzilla.gnome.org/show_bug.cgi?id=706456

12 years agotests/pull-corruption: Ensure we corrupt an object to be pulled
Colin Walters [Sun, 19 Jan 2014 17:39:38 +0000 (12:39 -0500)]
tests/pull-corruption: Ensure we corrupt an object to be pulled

This test had some nondeterminism because we chose a random
object to corrupt, but because there were multiple commits, it
was possible that we chose an object that was not being pulled.

Fix this by writing some custom GJS code to find an explicitly random
object that exists in a given ref, an change a random byte offset.
This adds a lot more randomness to the testing too.

12 years agolibostree: Ensure we set standard::type when querying files
Colin Walters [Sun, 19 Jan 2014 18:18:04 +0000 (13:18 -0500)]
libostree: Ensure we set standard::type when querying files

This makes the obvious code to recursively enumerate directories
operate more sanely.

Noticed this while trying to write corrupt-repo-ref.js.

12 years agopull: Add a few more g_debug() and assertions
Colin Walters [Sun, 19 Jan 2014 17:39:18 +0000 (12:39 -0500)]
pull: Add a few more g_debug() and assertions

To help track down the race condition better.

12 years agotests: Small tweaks to pull corruption test
Colin Walters [Sun, 19 Jan 2014 16:48:27 +0000 (11:48 -0500)]
tests: Small tweaks to pull corruption test

This one is failing here, I suspect it's the generic pull race
condition, but these fixes should make it slightly more reliable.

12 years agoUpdate .gitignore
Colin Walters [Sun, 19 Jan 2014 16:33:35 +0000 (11:33 -0500)]
Update .gitignore

12 years agodeploy/main: Unify some bits between admin-switch and admin-upgrade
Colin Walters [Sun, 19 Jan 2014 16:28:30 +0000 (11:28 -0500)]
deploy/main: Unify some bits between admin-switch and admin-upgrade

12 years agotest-sysroot: Update for API change
Colin Walters [Sat, 18 Jan 2014 22:50:22 +0000 (17:50 -0500)]
test-sysroot: Update for API change

12 years agoadmin/switch: New builtin to switch between trees
Colin Walters [Sat, 18 Jan 2014 22:42:24 +0000 (17:42 -0500)]
admin/switch: New builtin to switch between trees

This is something I want to make easier, as it better showcases the
flexibility of OSTree.

12 years agoSquash some harmless compiler warnings
Colin Walters [Sat, 18 Jan 2014 09:53:16 +0000 (04:53 -0500)]
Squash some harmless compiler warnings

None of these AFAICS actually can occur, but let's silence gcc.

12 years agolibotutil: Fix a possible uninitialized free() in error path
Colin Walters [Sat, 18 Jan 2014 09:52:45 +0000 (04:52 -0500)]
libotutil: Fix a possible uninitialized free() in error path

Spotted by gcc.

12 years agopackaging: Update infrastructure
Colin Walters [Sat, 18 Jan 2014 09:44:54 +0000 (04:44 -0500)]
packaging: Update infrastructure

The Makefile.dist-packaging lives canonically in rpm-ostree/ for now,
it's my latest hack to automate git -> (s)rpm.

Update the spec.in from current Fedora.

12 years agocommit: Reject non-regular/non-symlinks earlier with better error message
Colin Walters [Fri, 17 Jan 2014 15:32:34 +0000 (10:32 -0500)]
commit: Reject non-regular/non-symlinks earlier with better error message

Also avoid _NOT_SUPPORTED as that triggers the --help behavior from
the commandline; just use _FAILED.

https://bugzilla.gnome.org/show_bug.cgi?id=722410

12 years agodeploy: Rework kernel arguments, add --karg-append to "admin deploy"
Colin Walters [Thu, 16 Jan 2014 18:04:00 +0000 (13:04 -0500)]
deploy: Rework kernel arguments, add --karg-append to "admin deploy"

The "ordered hash" code was really just for kernel arguments.  And it
turns out it needs to be a multihash (for e.g. multiple console=
arguments).

So turn the OstreeOrderedHash into OstreeKernelArgs, and move the bits
to split key=value and such into there.

Now we're not making this public API yet - the public OstreeSysroot
just takes char **kargs.  To facilitate code reuse between ostree/ and
libostree/, make it a noinst libtool library.  It'll be duplicated in
the binary and library, but that's OK for now.  We can investigate
making OstreeKernelArgs public later.

https://bugzilla.gnome.org/show_bug.cgi?id=721136

12 years agoCOPYING: Update to latest FSF with current address
Colin Walters [Thu, 16 Jan 2014 15:20:47 +0000 (10:20 -0500)]
COPYING: Update to latest FSF with current address

Hooray for rpmlint.

12 years agoUnify uboot and syslinux test cases
Colin Walters [Wed, 15 Jan 2014 14:48:04 +0000 (09:48 -0500)]
Unify uboot and syslinux test cases

The test-admin-deploy-1 was copied into -uboot at some point.  But
really they should be testing exactly the same thing, except for
the bootloader backend.

Unify these tests by extracting a common test core.

12 years agoUpdate libgsystem
Colin Walters [Wed, 15 Jan 2014 14:19:09 +0000 (09:19 -0500)]
Update libgsystem

This has a GsConsole fix.

12 years agoadmin: Add --karg-proc-cmdline argument
Colin Walters [Mon, 13 Jan 2014 13:45:56 +0000 (08:45 -0500)]
admin: Add --karg-proc-cmdline argument

When installing a new tree inside an existing OS, this is a convenient
way to include the command line arguments one needs (such as root=).

12 years agodeploy: Write bootloader config even if just kernel arguments changed
Colin Walters [Wed, 15 Jan 2014 13:46:05 +0000 (08:46 -0500)]
deploy: Write bootloader config even if just kernel arguments changed

The official way to add bootloader arguments to the current deployment
is to redeploy with --karg.  However, doing so tripped up an
optimization made inside the deployment code to just swap the
bootlinks if we're keeping the same "bootcsum".

Change this optimization to look at the pair of (bootcsum, options).

12 years agobuild: Don't use += for ACLOCAL_AMFLAGS
Colin Walters [Sat, 11 Jan 2014 17:02:34 +0000 (10:02 -0700)]
build: Don't use += for ACLOCAL_AMFLAGS

It confuses the autotools.